package com.woniuxy.rdbc.controller;

import com.woniuxy.rdbc.entity.SysDept;
import com.woniuxy.rdbc.service.DeptService;
import com.woniuxy.rdbc.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("dept")
public class DeptController {
    @Autowired
    private DeptService deptService;
    @PostMapping("")
    public Result selAll(){
        List<SysDept> sysDepts = deptService.selectAll();
        return  Result.ok().data("list",sysDepts);
    }
}
